import { useWeight } from './weight'
import { CakeRoom } from './cakeRoom'

export const useCakeWeight = (cakeRoom:CakeRoom) => {
    let {
        takeCake
    } = cakeRoom
    let { weight, doMotion, eatFood: eatFood2 } = useWeight()

    const eatFood = () => {
        if (takeCake()) {
            eatFood2()
        } else {
            console.log('没有蛋糕吃了')
            return;
        }
    }

    return {
        weight,
        eatFood,
        doMotion,
    };
}